<?php
	/**
	*	定时重连的服务脚本
	**/
	include_once dirname(dirname(__FILE__))."/include/common.inc.php";
	$global_site = "dialService";
	
	$lockfile = ROOT_PATH."/dialService/network.lock";
	if(adsl_disconnect() == 0){
		printlog("disconnect success", "adsl");
		if(!unlink($lockfile)){
			printlog("delete lockfile failed", "adsl");
		}
	}
	if(adsl_dial() == 0){
		printlog("dialing success", "adsl");
		if(file_put_contents($lockfile, date("Y-m-d H:i:s"))<2){
			printlog("write lockfile failed", "adsl");
		}
	}
	
?>